package edu.pku.sei.transformation.editor.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.swt.SWT;

import edu.pku.sei.transformation.editor.model.Comment;
import edu.pku.sei.transformation.editor.views.dialogs.ContentDialog;

public class OpenContentDialogAction extends Action {
	private Comment template;

	public OpenContentDialogAction(Comment t) {
		this.setText("open content dialog");
		template = t;
	}

	@Override
	public void run() {
		ContentDialog d = new ContentDialog();
		d.setDocumentResult(template.getContent());
		int result = d.open();
		if (result == SWT.OK) {
			template.setContent(d.getDocumentResult());
		} else {

		}
	}
}
